﻿using System;
using System.Collections.Generic;
using UnityEngine;

// Token: 0x02000313 RID: 787
public class ExcelData : ScriptableObject
{
	// Token: 0x170001E1 RID: 481
	public string this[int cell, int row]
	{
		get
		{
			return this.Get(cell, row);
		}
	}

	// Token: 0x170001E2 RID: 482
	// (get) Token: 0x060013D0 RID: 5072 RVA: 0x0008C338 File Offset: 0x0008A538
	public int MaxCell
	{
		get
		{
			return this.list.Count;
		}
	}

	// Token: 0x060013D1 RID: 5073 RVA: 0x0008C348 File Offset: 0x0008A548
	public string Get(ExcelData.Specify specify)
	{
		return this.Get(specify.cell, specify.row);
	}

	// Token: 0x060013D2 RID: 5074 RVA: 0x0008C35C File Offset: 0x0008A55C
	public string Get(int cell, int row)
	{
		string result = string.Empty;
		if (cell < this.list.Count && row < this.list[cell].list.Count)
		{
			result = this.list[cell].list[row];
		}
		return result;
	}

	// Token: 0x060013D3 RID: 5075 RVA: 0x0008C3B8 File Offset: 0x0008A5B8
	public List<string> GetCell(int row)
	{
		List<string> list = new List<string>();
		foreach (ExcelData.Param param in this.list)
		{
			if (row < param.list.Count)
			{
				list.Add(param.list[row]);
			}
		}
		return list;
	}

	// Token: 0x060013D4 RID: 5076 RVA: 0x0008C438 File Offset: 0x0008A638
	public List<string> GetCell(int rowStart, int rowEnd)
	{
		List<string> list = new List<string>();
		if ((ulong)rowStart > (ulong)((long)rowEnd))
		{
			return list;
		}
		foreach (ExcelData.Param param in this.list)
		{
			int num = rowStart;
			while (num < param.list.Count && num <= rowEnd)
			{
				list.Add(param.list[num]);
				num++;
			}
		}
		return list;
	}

	// Token: 0x060013D5 RID: 5077 RVA: 0x0008C4D4 File Offset: 0x0008A6D4
	public List<string> GetRow(int cell)
	{
		List<string> list = new List<string>();
		if (cell < this.list.Count)
		{
			foreach (string item in this.list[cell].list)
			{
				list.Add(item);
			}
		}
		return list;
	}

	// Token: 0x060013D6 RID: 5078 RVA: 0x0008C554 File Offset: 0x0008A754
	public List<string> GetRow(int cellStart, int cellEnd)
	{
		List<string> list = new List<string>();
		if ((ulong)cellStart > (ulong)((long)cellEnd))
		{
			return list;
		}
		int num = cellStart;
		while (num < this.list.Count && num <= cellEnd)
		{
			foreach (string item in this.list[num].list)
			{
				list.Add(item);
			}
			num++;
		}
		return list;
	}

	// Token: 0x060013D7 RID: 5079 RVA: 0x0008C5F0 File Offset: 0x0008A7F0
	public List<ExcelData.Param> Get(ExcelData.Specify start, ExcelData.Specify end)
	{
		List<ExcelData.Param> list = new List<ExcelData.Param>();
		if ((ulong)start.cell > (ulong)((long)end.cell) || (ulong)start.row > (ulong)((long)end.row))
		{
			return list;
		}
		if (start.cell < this.list.Count)
		{
			int num = start.cell;
			while (num < this.list.Count && num <= end.cell)
			{
				ExcelData.Param param = new ExcelData.Param();
				if (start.row < this.list[num].list.Count)
				{
					param.list = new List<string>();
					int num2 = start.row;
					while (num2 < this.list[num].list.Count && num2 <= end.row)
					{
						param.list.Add(this.list[num].list[num2]);
						num2++;
					}
				}
				list.Add(param);
				num++;
			}
		}
		return list;
	}

	// Token: 0x060013D8 RID: 5080 RVA: 0x0008C704 File Offset: 0x0008A904
	public List<ExcelData.Param> Get(ExcelData.Specify start, ExcelData.Specify end, string find)
	{
		List<ExcelData.Param> list = new List<ExcelData.Param>();
		list = this.Get(start, end);
		foreach (ExcelData.Param param in list)
		{
			foreach (string b in param.list)
			{
				if (find == b)
				{
					ExcelData.Param param2 = new ExcelData.Param();
					param2.list = new List<string>();
					foreach (string item in param.list)
					{
						param2.list.Add(item);
					}
					list.Add(param2);
					break;
				}
			}
		}
		return list;
	}

	// Token: 0x060013D9 RID: 5081 RVA: 0x0008C82C File Offset: 0x0008AA2C
	public List<ExcelData.Param> Find(string find)
	{
		List<ExcelData.Param> list = new List<ExcelData.Param>();
		foreach (ExcelData.Param param in this.list)
		{
			foreach (string b in param.list)
			{
				if (find == b)
				{
					ExcelData.Param param2 = new ExcelData.Param();
					param2.list = new List<string>();
					foreach (string item in param.list)
					{
						param2.list.Add(item);
					}
					list.Add(param2);
					break;
				}
			}
		}
		return list;
	}

	// Token: 0x060013DA RID: 5082 RVA: 0x0008C950 File Offset: 0x0008AB50
	public List<ExcelData.Param> FindArea(string find, ExcelData.Specify spe)
	{
		List<ExcelData.Param> list = new List<ExcelData.Param>();
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < this.list.Count; i++)
		{
			for (int j = 0; j < this.list[i].list.Count; j++)
			{
				if (find == this.list[i].list[j])
				{
					num = i + 1;
					num2 = j;
					break;
				}
			}
		}
		int num3 = num;
		while (num3 < this.list.Count && num3 < num + spe.cell)
		{
			ExcelData.Param param = new ExcelData.Param();
			int num4 = num2;
			while (num4 < this.list[num3].list.Count && num4 < num2 + spe.row)
			{
				param.list = new List<string>();
				param.list.Add(this.list[num3].list[num4]);
				list.Add(param);
				num4++;
			}
			num3++;
		}
		return list;
	}

	// Token: 0x060013DB RID: 5083 RVA: 0x0008CA88 File Offset: 0x0008AC88
	public List<ExcelData.Param> FindArea(string find)
	{
		List<ExcelData.Param> list = new List<ExcelData.Param>();
		int num = 0;
		int num2 = 0;
		for (int i = 0; i < this.list.Count; i++)
		{
			for (int j = 0; j < this.list[i].list.Count; j++)
			{
				if (find == this.list[i].list[j])
				{
					num = i + 1;
					num2 = j;
					break;
				}
			}
		}
		for (int k = num; k < this.list.Count; k++)
		{
			ExcelData.Param param = new ExcelData.Param();
			for (int l = num2; l < this.list[k].list.Count; l++)
			{
				param.list = new List<string>();
				param.list.Add(this.list[k].list[l]);
				list.Add(param);
			}
		}
		return list;
	}

	// Token: 0x040018B8 RID: 6328
	public List<ExcelData.Param> list = new List<ExcelData.Param>();

	// Token: 0x02000314 RID: 788
	public class Specify
	{
		// Token: 0x060013DC RID: 5084 RVA: 0x0008CBA4 File Offset: 0x0008ADA4
		public Specify(int cell, int row)
		{
			this.cell = cell;
			this.row = row;
		}

		// Token: 0x060013DD RID: 5085 RVA: 0x0008CBBC File Offset: 0x0008ADBC
		public Specify()
		{
		}

		// Token: 0x040018B9 RID: 6329
		public int cell;

		// Token: 0x040018BA RID: 6330
		public int row;
	}

	// Token: 0x02000315 RID: 789
	[Serializable]
	public class Param
	{
		// Token: 0x040018BB RID: 6331
		public List<string> list = new List<string>();
	}
}
